package com.bootdo.app;

import com.bootdo.common.controller.BaseController;
import com.bootdo.common.domain.DictDO;
import com.bootdo.common.service.DictService;
import com.bootdo.common.utils.DictUtils;
import com.bootdo.common.utils.R;
import com.bootdo.common.utils.StringUtils;
import com.bootdo.system.domain.IntegralLogDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("/app/common/")
public class AppCommonController {

    @Autowired
    private DictService dictService;

    /**
     * 获取数据字段数据
     * @return
     */
    @ResponseBody
    @PostMapping("/getDictData")
    public R getDictData(){
        DictDO dictDO = DictUtils.getDictByType("online_count");
        Map<String,Object> map = new HashMap<String,Object>();
        map.put("onlineCount",dictDO.getValue());
        DictDO dictDO1 = DictUtils.getDictByType("live_broadcast");
        map.put("liveBroadcast",dictDO1.getValue());
        return R.ok(map);
    }

}
